package com.indusfo.spc.pojo;

import com.indusfo.spc.common.pojo.BasePojo;
import com.indusfo.spc.vo.AssociTionTreeNode;
import com.indusfo.spc.vo.SimpleTreeNode;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
import java.util.List;

/**
 * 角色表实现类
 * @author 贺闻博
 *
 *   2018年11月28日
 */
@Table(name="sys_role")
public class Role extends BasePojo{
  //角色ID
  @Id
  @Column(name="ROLE_ID",insertable=false)
  private Integer roleId;
  //角色名称
  private String roleName;

  private Integer userId;

  @Transient
  private String userName;

  private String remark;

  private Integer dataState;

  //状态数据字典翻译
  @Transient
  private String dataStateName;

  //创建时间
  private Date createDate;

  //更改时间
  private Date modifyDate;

  //数据权限
  private Integer dataPermission;

  //数据权限数据字典翻译
  @Transient
  private String dataPermissionName;


  // 菜单权限集合
  @Transient
  private List<String> menuCodeList;

  // 菜单权限集合
  @Transient
  private List<Integer> menuIdList;

  // 数据权限集合
  @Transient
  private List<Integer> depList;

  // 用户授权角色
  @Transient
  private List<Integer> userIdList;

  // 作业授权集合
  @Transient
  private List<String> staIdList;

  // 菜单权限树
  @Transient
  List<SimpleTreeNode> menuTreeList;

  // 数据权限集合
  @Transient
  List<AssociTionTreeNode> associTionList;

  // 用户权限集合
  @Transient
  List<RoleUser> roleUserList;

  // 作业授权集合
  @Transient
  List<AssociTionTreeNode> workPermissionList;

  public Integer getRoleId() {
    return roleId;
  }

  public void setRoleId(Integer roleId) {
    this.roleId = roleId;
  }

  public String getRoleName() {
    return roleName;
  }

  public void setRoleName(String roleName) {
    this.roleName = roleName;
  }

  public Integer getUserId() {
    return userId;
  }

  public void setUserId(Integer userId) {
    this.userId = userId;
  }

  public String getUserName() {
    return userName;
  }

  public void setUserName(String userName) {
    this.userName = userName== null ? null : userName.trim().replace(" ","");
  }

  public String getRemark() {
    return remark;
  }

  public void setRemark(String remark) {
    this.remark = remark== null ? null : remark.trim().replace(" ","");
  }

  public Integer getDataState() {
    return dataState;
  }

  public void setDataState(Integer dataState) {
    this.dataState = dataState;
  }

  public String getDataStateName() {
    return dataStateName;
  }

  public void setDataStateName(String dataStateName) {
    this.dataStateName = dataStateName;
  }

  public Date getCreateDate() {
    return createDate;
  }

  public void setCreateDate(Date createDate) {
    this.createDate = createDate;
  }

  public Date getModifyDate() {
    return modifyDate;
  }

  public void setModifyDate(Date modifyDate) {
    this.modifyDate = modifyDate;
  }

  public Integer getDataPermission() {
    return dataPermission;
  }

  public void setDataPermission(Integer dataPermission) {
    this.dataPermission = dataPermission;
  }

  public String getDataPermissionName() {
    return dataPermissionName;
  }

  public void setDataPermissionName(String dataPermissionName) {
    this.dataPermissionName = dataPermissionName;
  }

  public List<String> getMenuCodeList() {
    return menuCodeList;
  }

  public void setMenuCodeList(List<String> menuCodeList) {
    this.menuCodeList = menuCodeList;
  }

  public List<Integer> getMenuIdList() {
    return menuIdList;
  }

  public void setMenuIdList(List<Integer> menuIdList) {
    this.menuIdList = menuIdList;
  }

  public List<Integer> getDepList() {
    return depList;
  }

  public void setDepList(List<Integer> depList) {
    this.depList = depList;
  }

  public List<Integer> getUserIdList() {
    return userIdList;
  }

  public void setUserIdList(List<Integer> userIdList) {
    this.userIdList = userIdList;
  }

  public List<String> getStaIdList() {
    return staIdList;
  }

  public void setStaIdList(List<String> staIdList) {
    this.staIdList = staIdList;
  }

  public List<SimpleTreeNode> getMenuTreeList() {
    return menuTreeList;
  }

  public void setMenuTreeList(List<SimpleTreeNode> menuTreeList) {
    this.menuTreeList = menuTreeList;
  }

  public List<AssociTionTreeNode> getAssociTionList() {
    return associTionList;
  }

  public void setAssociTionList(List<AssociTionTreeNode> associTionList) {
    this.associTionList = associTionList;
  }

  public List<RoleUser> getRoleUserList() {
    return roleUserList;
  }

  public void setRoleUserList(List<RoleUser> roleUserList) {
    this.roleUserList = roleUserList;
  }

  public List<AssociTionTreeNode> getWorkPermissionList() {
    return workPermissionList;
  }

  public void setWorkPermissionList(List<AssociTionTreeNode> workPermissionList) {
    this.workPermissionList = workPermissionList;
  }
}
